package com.kai.service.util;

import java.util.concurrent.*;

public class ExecutorUtil {

    private final static ExecutorService executorService = new ThreadPoolExecutor(
            Runtime.getRuntime().availableProcessors(),
            Runtime.getRuntime().availableProcessors() * 2, 60, TimeUnit.SECONDS,
            new LinkedBlockingQueue<>(50000));

    public static void execute(Runnable runnable) {
        executorService.execute(runnable);
    }

    public static void submit(Runnable runnable) {
        executorService.submit(runnable);
    }
}
